/**
 * 
 */
package fr.gfi.agraf.vue.bean;

import java.util.Date;
import java.util.List;

/**
 * @author eleve
 * 
 */
public class PerimetreDTO implements Comparable<PerimetreDTO> {

	private Long id;

	private String libelle;

	private Date dateDebut;

	private Date dateFin;

	private Date dateCreation;

	private EtatDTO etatDTO;

	private List<ActiviteDTO> listeActivite;

	private boolean modifiable;

	private boolean supprimable;

	private int pourcentAvancement;

	private double chargeInitTotale;

	private double rafTotal;

	private double consommeTotal;

	private int productiviteEstimee;

	private List<ActiviteDTO> listeActiviteEnCours;

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(final PerimetreDTO perimetre) {
		return (int) (this.id - perimetre.getId());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null || getClass() != obj.getClass()) {
			return false;
		}
		final PerimetreDTO perimetre = (PerimetreDTO) obj;
		if (!perimetre.getId().equals(this.getId())) {
			return false;
		}

		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		if (id == null || id == 0) {
			return super.hashCode();
		}
		return (int) (7 * id);
	}

	/**
	 * @return the listeActivite
	 */
	public List<ActiviteDTO> getListeActivite() {
		return listeActivite;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(final Long id) {
		this.id = id;
	}

	/**
	 * @return the libelle
	 */
	public String getLibelle() {
		return libelle;
	}

	/**
	 * @param libelle
	 *            the libelle to set
	 */
	public void setLibelle(final String libelle) {
		this.libelle = libelle;
	}

	/**
	 * @return the dateDebut
	 */
	public Date getDateDebut() {
		return dateDebut;
	}

	/**
	 * @param dateDebut
	 *            the dateDebut to set
	 */
	public void setDateDebut(final Date dateDebut) {
		this.dateDebut = dateDebut;
	}

	/**
	 * @return the dateFin
	 */
	public Date getDateFin() {
		return dateFin;
	}

	/**
	 * @param dateFin
	 *            the dateFin to set
	 */
	public void setDateFin(final Date dateFin) {
		this.dateFin = dateFin;
	}

	/**
	 * @return the dateCreation
	 */
	public Date getDateCreation() {
		return dateCreation;
	}

	/**
	 * @param dateCreation
	 *            the dateCreation to set
	 */
	public void setDateCreation(final Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	/**
	 * @return the etatDTO
	 */
	public EtatDTO getEtatDTO() {
		return etatDTO;
	}

	/**
	 * @param etatDTO
	 *            the etatDTO to set
	 */
	public void setEtatDTO(final EtatDTO etatDTO) {
		this.etatDTO = etatDTO;
	}

	/**
	 * @param listeActivite
	 *            the listeActivite to set
	 */
	public void setListeActivite(final List<ActiviteDTO> listeActivite) {
		this.listeActivite = listeActivite;
	}

	/**
	 * @return the modifiable
	 */
	public boolean isModifiable() {
		return modifiable;
	}

	/**
	 * @param modifiable
	 *            the modifiable to set
	 */
	public void setModifiable(final boolean modifiable) {
		this.modifiable = modifiable;
	}

	/**
	 * @return the supprimable
	 */
	public boolean isSupprimable() {
		return supprimable;
	}

	/**
	 * @param supprimable
	 *            the supprimable to set
	 */
	public void setSupprimable(final boolean supprimable) {
		this.supprimable = supprimable;
	}

	/**
	 * @return the pourcentAvancement
	 */
	public int getPourcentAvancement() {
		return pourcentAvancement;
	}

	/**
	 * @param pourcentAvancement
	 *            the pourcentAvancement to set
	 */
	public void setPourcentAvancement(final int pourcentAvancement) {
		this.pourcentAvancement = pourcentAvancement;
	}

	/**
	 * @return the chargeInitTotale
	 */
	public double getChargeInitTotale() {
		return chargeInitTotale;
	}

	/**
	 * @param chargeInitTotale
	 *            the chargeInitTotale to set
	 */
	public void setChargeInitTotale(final double chargeInitTotale) {
		this.chargeInitTotale = chargeInitTotale;
	}

	/**
	 * @return the rafTotal
	 */
	public double getRafTotal() {
		return rafTotal;
	}

	/**
	 * @param rafTotal
	 *            the rafTotal to set
	 */
	public void setRafTotal(final double rafTotal) {
		this.rafTotal = rafTotal;
	}

	/**
	 * @return the consommeTotal
	 */
	public double getConsommeTotal() {
		return consommeTotal;
	}

	/**
	 * @param consommeTotal
	 *            the consommeTotal to set
	 */
	public void setConsommeTotal(final double consommeTotal) {
		this.consommeTotal = consommeTotal;
	}

	/**
	 * @return the productiviteEstimee
	 */
	public int getProductiviteEstimee() {
		return productiviteEstimee;
	}

	/**
	 * @param productiviteEstimee
	 *            the productiviteEstimee to set
	 */
	public void setProductiviteEstimee(final int productiviteEstimee) {
		this.productiviteEstimee = productiviteEstimee;
	}

	/**
	 * @return the listeActiviteEnCours
	 */
	public List<ActiviteDTO> getListeActiviteEnCours() {
		return listeActiviteEnCours;
	}

	/**
	 * @param listeActiviteEnCours
	 *            the listeActiviteEnCours to set
	 */
	public void setListeActiviteEnCours(final List<ActiviteDTO> listeActiviteEnCours) {
		this.listeActiviteEnCours = listeActiviteEnCours;
	}

}
